package cn.accp.mvc.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.accp.mvc.entity.User;

@Controller
public class UserController {
	@RequestMapping("/login2")
	public String login(User user,HttpSession session){
		if(user.getName().equals("maizi")&&user.getPwd().equals("123")){
			session.setAttribute("user", user);
			return "redirect:/login.jsp";
		}else {
			return "redirect:/index.jsp";
		}
	}
	@RequestMapping("/test")
	public String test(){
		System.out.println("test");
		return "redirect:/json.jsp";
	}
}
